﻿using System;
using System.Collections.Generic;
using System.Text;
using ESpace.DalTools.SqlServer.DotNet;
using ESpace.DalTools.SQLite;
using ESpace.DalTools.SqlServer;

namespace ESpace.DalTools.Contracts
{
	public interface IServiceBuilder
	{
		string DBServer { get; set; }
		string DBName { get; set; }
		string DBPassword { get; set; }
		string DBUid { get; set; }
		string ConnectionString { get; set; }
		string SavePath { get; set; }
		string TableName { get; set; }
		string NameSpace { get; set; }
		string ContractsNameSpace { get; set; }
		string EntityNameSpace { get; set; }
		string BusinessNameSpace { get; set; }
		void BuilderServiceCode();
		void ConnectToDB();
		void DisconnectFromDB();
	}

	public static class BuilderServiceFactory
	{
		public static IServiceBuilder Creator(string dbType)
		{

			IServiceBuilder ienb;

			switch (dbType)
			{
				case "SqlServer":
					ienb = new ServiceBuilder();
					break;
				case "Sqlite":
					ienb = new ServiceBuilderSQLite();
					break;
				//case "MySql":
				//    break;
				//case "Access":
				//    break;
				default:
					ienb = new ServiceBuilder();
					break;

			}
			return ienb;

		}
	}

}
